//
//  DiscountedView.m
//  ProjectForA
//
//  Created by hmengwei on 14/11/19.
//  Copyright (c) 2014年 hmengwei. All rights reserved.
//

#import "DiscountedView.h"

@implementation DiscountedView

- (void)dealloc
{
    [super dealloc];
}

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        self.imageView = [[UIImageView alloc] initWithFrame:CGRectMake(10, 0, self.frame.size.width - 20, self.frame.size.height)];
        [_imageView setBackgroundColor:[UIColor grayColor]];
        [_imageView.layer setCornerRadius:10];
        _imageView.layer.masksToBounds = YES;
        [self addSubview:_imageView];
    }
    return self;
}


- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
    
    
    NSObject *obj = (NSObject *)self.target;
    
    if ([obj respondsToSelector:self.action]) {
        [obj performSelector:self.action withObject:self];
    } else {
        
        NSLog(@"%@ 方法没有实现",NSStringFromSelector(self.action));
    }
    
    
}


@end
